Skip to content

Conversation

Soumyadipta-Banerjee
Copy link

@Soumyadipta-Banerjee Soumyadipta-Banerjee commented Oct 1, 2025

Description of Change:-

This pull request adds a C++ implementation of the Weighted Interval Scheduling problem to the Dynamic Programming section.

The algorithm finds the maximum profit from a subset of non-overlapping intervals, where each interval has a start time, end time, and an associated profit. This implementation uses dynamic programming with a binary search optimization to achieve an efficient O(n log n) time complexity.

The submission is self-contained, with detailed Doxygen documentation and a test() function that includes multiple verified test cases to ensure correctness.

Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md
-->

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Adds an O(n log n) solution for the Weighted Interval Scheduling problem using DP and binary search.

@Soumyadipta-Banerjee
Copy link
Author

This is my first ever attempt at open source contribution. I wish to be a part of the open source community in the future and make many meaningful contributions

@DataWorshipper
Copy link

Heyy Soumyadipta ,your code looks pretty good for the weighted interval scheduling,ig the owners of this repo can close the issue that i brought up in the issues section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants